chose the tests to relate to this task <br/>
<button type='button' onclick='tasks.task.relateTests(<?php echo $taskId?>)'>relate</button>
&nbsp;
<button type='button' onclick='tasks.task.showNodeData({id:<?php echo $taskId?>,tab:4})'>cancel</button>
<form id='testsForm' method=post>
<?php foreach($tests as $dir=>$classes): ?>
  <div class='testClass' id='div<?php echo $dir; ?>'>
    <a href='javascript:void(0)' onclick='$("#dir<?php echo $dir; ?>").toggle("slow");'>
      <h3><?php echo $dir; ?></h3>
    </a>
  </div>
  <div id='dir<?php echo $dir; ?>' class='testClassItems'>
<?php foreach($classes as $className=>$tests): ?>
  <div class='testClass' id='div<?php echo $className; ?>'>
    <a href='javascript:void(0)' onclick='$("#testClassItems<?php echo $className; ?>").toggle("fast");'>
      <b><?php echo $className; ?></b>
    </a>
  </div>
  <div id='testClassItems<?php echo $className; ?>' class='testClassItems' <?php if(!$classRelatedCount[$className]): ?>style='display:none;'<?php endif; ?>>
<?php foreach($tests as $id=>$test):?>
  <input 
    type='checkbox' 
    name='arTaskTest[]' 
    value='<?php echo $id ?>'
    <?php if($test['related']): ?>checked<?php endif; ?>
  />
  <?php echo $test['testName'] ?> <span style='color:#999'> tasks:<?php echo $test['numTasks'] ?></span><br/>
<? endforeach; ?>
  </div>
<? endforeach; ?>
  </div>
<? endforeach; ?>
</form>
<br/>
<button type='button' onclick='tasks.task.relateTests(<?php echo $taskId?>)'>relate</button>
&nbsp;
<button type='button' onclick='tasks.task.showNodeData({id:<?php echo $taskId?>,tab:4})'>cancel</button>